import { t } from '@lingui/macro';
import * as BASE from '@/stores/definitions-base';

const {
  DATETIME_TEXT,
  DATE_TEXT,
  TIME_TEXT,
  EMPTY_TEXT,
  ENUMS: ENUMSBase,
  FieldsGrid: FieldGridBase,
  TitleGrid,
  column: columnBase,
  toSelectDataSource,
} = BASE;

export { DATETIME_TEXT, DATE_TEXT, EMPTY_TEXT, TIME_TEXT, TitleGrid, toSelectDataSource };

export function column(...args) {
  return columnBase(orderModel, ...args);
}

export function FieldsGrid(props) {
  return <FieldGridBase model={orderModel} {...props} />;
}

//----------------------------------------------------------------------
export const ENUMS = {
  ...ENUMSBase,
  isReturn: {
    0: t`去程`,
    1: t`回程`,
  },
  ticketStatus: {
    0: t`已取消`,
    1: t`未乘车`,
    2: t`已乘车`,
    3: t`已完成`,
    4: t`状态未知`,
    5: t`已过期`,
  },
  refundStatus: {
    0: t`未退款`,
    1: t`已退款`,
  },
  orderStatus: {
    0: t`已取消`,
    1: t`已支付`,
    2: t`进行中`,
    3: t`已完成`,
  },
};

export const MAGIC_NUMBERS = {
  // 汇总类型
  SUMMARY_TYPE: {
    // 0-实收 1-支出 2-利润 3-退款 4-承运商 5-司机
    realIncome: 0,
    paid: 1,
    profit: 2,
    refund: 3,
    company: 4,
    driver: 5,
  },
};

export const orderModel = {
  orderId: {
    label: t`订单编号`,
  },
  salesDate: {
    label: t`销售日期`,
    text: DATETIME_TEXT,
  },
  passengerName: {
    label: t`乘客姓名`,
  },
  ticketCode: {
    label: t`车票票号`,
  },
  isReturn: {
    label: t`单双程`,
    // 0-去程 1-回程`,
  },
  fromStation: {
    label: t`出发站点`,
  },
  toStation: {
    label: t`到达站点`,
  },
  shiftTime: {
    label: t`开车时间`,
    text: DATETIME_TEXT,
  },
  operatingState: {
    label: t`中港通车票状态`,
  },
  price: {
    label: t`价格`,
  },
  disbursement: {
    label: t`支出`,
  },
  profit: {
    label: t`利润`,
  },
  refundTime: {
    label: t`退款时间`,
    text: DATETIME_TEXT,
  },
  refundPrice: {
    label: t`退款金额`,
  },
  remark: {
    label: t`备注`,
  },
  companyName: {
    label: t`承运商`,
  },
  driverName: {
    label: t`司机`,
  },
  orderPrice: {
    label: t`订单价格`,
  },
  companyPrice: {
    label: t`承运商价格`,
  },
  driverPrice: {
    label: t`司机价格`,
  },
  orderState: {
    label: t`订单状态`,
  },
};
